package com.elitel.frame.web.cfgshowfield.service.impl;

import com.elitel.frame.web.cfgshowfield.dao.CfgShowFieldDao;
import com.elitel.frame.web.cfgshowfield.entity.CfgShowField;
import com.elitel.frame.web.cfgshowfield.service.CfgShowFieldService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 基本信息-服务显示列(BaseShowfield)表服务实现类
 *
 * @author makejava
 * @since 2025-05-19 16:09:22
 */
@Service
public class CfgShowFieldServiceImpl implements CfgShowFieldService {
    @Resource
    private CfgShowFieldDao cfgShowFieldDao;

    /**
     * 通过ID查询单条数据
     *
     * @param guid 主键
     * @return 实例对象
     */
    @Override
    public CfgShowField queryById(String guid) {
        return this.cfgShowFieldDao.queryById(guid);
    }


    /**
     * 新增数据
     *
     * @param cfgShowField 实例对象
     * @return 实例对象
     */
    @Override
    public CfgShowField insert(CfgShowField cfgShowField) {
        this.cfgShowFieldDao.insert(cfgShowField);
        return cfgShowField;
    }

    /**
     * 修改数据
     *
     * @param cfgShowField 实例对象
     * @return 实例对象
     */
    @Override
    public CfgShowField update(CfgShowField cfgShowField) {
        this.cfgShowFieldDao.update(cfgShowField);
        return this.queryById(cfgShowField.getGuid());
    }

    /**
     * 通过主键删除数据
     *
     * @param guid 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(String guid) {
        return this.cfgShowFieldDao.deleteById(guid) > 0;
    }
}
